import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';

/**
 * Generated class for the QrCodePage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-qr-code',
  templateUrl: 'qr-code.html',
})
export class QrCodePage {
  private imageAddress = '';
  private params = [];
  private imageSrc = '';
  private table = {};

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.imageAddress = this.navParams.get('imageAddress');
    this.params = this.navParams.get('params');
    let temp = '';
    for (let i = 0; i < this.params.length; i++) {
      if (i === 0)
        temp += this.params[i];
      else
        temp += '&' + this.params[i];
    }
    this.imageSrc = this.imageAddress + '?' + temp;
    this.table = this.navParams.get('table');
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad QrCodePage');
  }

}
